<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇游戏</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="container">
        <h1>贪吃蛇游戏</h1>
        <div class="game-info">
            <div class="score">得分: <span id="current-score">0</span></div>
            <div class="high-score">最高分: <span id="high-score">0</span></div>
            <div class="controls">
                <button id="start-btn">开始游戏</button>
                <button id="pause-btn" disabled>暂停</button>
                <button id="restart-btn" disabled>重新开始</button>
            </div>
        </div>
        <canvas id="game-canvas" width="400" height="400"></canvas>
        <div class="instructions">
            <p>使用方向键 ↑ ↓ ← → 控制蛇的移动</p>
            <p>吃到红色食物得分，撞墙或撞到自己游戏结束</p>
        </div>
    </div>
    
    <div id="game-over-modal" class="modal hidden">
        <div class="modal-content">
            <h2>游戏结束</h2>
            <p>最终得分: <span id="final-score">0</span></p>
            <button id="play-again-btn">再玩一次</button>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html>
